package com.company.behavioral.strategy_pattern.conctete_strategy;

import com.company.behavioral.strategy_pattern.strategy.Discount;

/**
 * 儿童票折扣类
 * @ClassName ChildrenDiscount
 * @Author tiezheng.han
 * @Date 2020/9/7 15:39
 **/
public class ChildrenDiscount implements Discount {

    private final double DISCOUNT = 10;

    @Override
    public double calculate(double price) {
        System.out.println("儿童票：");
        if (price >= 20){
            return price - DISCOUNT;
        } else{
            return price;
        }
    }
}
